//
//  UIView+Extension.swift
//  lpzK-swift-2016
//
//  Created by 刘培壮 on 16/6/1.
//  Copyright © 2016年 上海实奥信息技术有限公司. All rights reserved.
//

import UIKit

extension UIView {
    
    var lpz_x : CGFloat {
        set {
            var tmpFrame : CGRect = frame
            tmpFrame.origin.x = newValue
            frame = tmpFrame
        }
        get {
            return frame.origin.x
        }
    }
    
    var lpz_y : CGFloat {
        set {
            var tmpFrame : CGRect = frame
            tmpFrame.origin.y = newValue
            frame = tmpFrame
        }
        get {
            return frame.origin.y
        }
    }
    
    var lpz_centerX : CGFloat {
        set {
            var tmpCenter : CGPoint = center
            tmpCenter.x = newValue
            center = tmpCenter
        }
        get {
            return center.x
        }
    }

    var lpz_centerY : CGFloat {
        set {
            var tmpCenter : CGPoint = center
            tmpCenter.y = newValue
            center = tmpCenter
        }
        get {
            return center.y
        }
    }

    var lpz_width : CGFloat {
        set {
            var tmpFrame : CGRect = frame
            tmpFrame.size.width = newValue
            frame = tmpFrame
        }
        get {
            return frame.size.width
        }
    }

    var lpz_height : CGFloat {
        set {
            var tmpFrame : CGRect = frame
            tmpFrame.size.height = newValue
            frame = tmpFrame
        }
        get {
            return frame.size.height
        }
    }

    var lpz_origin : CGPoint {
        set {
            var tmpFrame : CGRect = frame
            tmpFrame.origin = newValue
            frame = tmpFrame
        }
        get {
            return frame.origin
        }
    }

    var lpz_size : CGSize {
        set {
            var tmpFrame : CGRect = frame
            tmpFrame.size = newValue
            frame = tmpFrame
        }
        get {
            return frame.size
        }
    }

    var lpz_maxX : CGFloat {
        get {
            return frame.maxX
        }
    }
    
    var lpz_maxY : CGFloat {
        get {
            return frame.maxY
        }
    }
    
}
